<html>
<head>
<title>Sign up</title>
<LINK REL=StyleSheet HREF="Style.css" TYPE="text/css" >
<script language="JavaScript">
function validateForm(){
	var alerttext = "";
	var valid = true;
	var fn=document.forms["information"]["firstname"].value;
	var ln=document.forms["information"]["lastname"].value;
	//var add=document.forms["information"]["address"].value;
	//var city=document.forms["information"]["city"].value;
	var zipcode=document.forms["information"]["zipcode"].value;
	var email=document.forms["information"]["email"].value;
	var loginname=document.forms["information"]["username"].value;
	var password = document.forms["information"]["password"].value;
	var confirmpassword = document.forms["information"]["confirmpassword"].value;
if (fn==null || fn=="")
  {
  alerttext += "First name must be filled out\n";
  valid = false;
  }
 if(ln==null || ln==""){
	alerttext += "Last name must be filled out.\n";
	valid = false;
 } 
 if(zipcode==null || zipcode==""){
	alerttext += "Zipcode must be filled out.\n";
	valid = false;
}
var zippattern = /^[0-9]{5}$/;
//alerttext += "zip code is " + zip_id + "\n";
if(zipcode != ""){
	if(!zippattern.exec(zipcode)){
	alerttext += "Invalid zipcode. Enter 5 digits for Zip Code\n";
	valid = false;
	} 
	}
 if(loginname==null || loginname==""){
	alerttext += "Username must be filled out.\n";
	valid = false;
}
 if(password==null || password==""){
	alerttext += "password must be filled out.\n";
	valid = false;
}
if(!(confirmpassword == password)){
	alerttext += "password are not match.\n"
	valid = false;
}
if(email==null || email==""){
	alerttext += "email must be filled out.\n";
	valid = false;
 } 
//alerttext += "password " + password + " confirmpassword " + confirmpassword;
 if(valid == false){
	alert(alerttext);
 }
 
 return valid;
}

</script>
</head>
<body>
<div align='center' width='800'>
<div align='center'>
		<img src='img/logoicon.png'>
	</div>
<h1 class='Title'>Sign up with us!</h1>
<hr width='1000'>
<br>
<form name='information' onsubmit='return validateForm()' method=POST action=/cgi-bin/signup>
<table border='0' width='700'>
<table border='0' width='700'>
<tr>
	<td>First Name *</td>
	<td width='500'><input name='firstname' size='60'></td>
</tr>
<tr>
	<td>Middle Name</td>
	<td width='500'><input name='middlename' size='60'></td>
</tr>
<tr>
	<td>Last Name *</td>
	<td width='500'><input name='lastname' size='60'></td>
</tr>
<tr>
	<td>Address</td>
	<td width='500'><input name='address' size='60'></td>
</tr>
<tr>
	<td>City</td>
	<td width='500'><input name='city' size='60'></td>
</tr>
<tr>
	<td>State</td>
	<td width='500'><select name='state'>
		<option value='AL'>AL</option>
		<option value='AK'>AK</option>
		<option value='AZ'>AZ</option>
		<option value='AR'>AR</option>
		<option value='CA'>CA</option>
		<option value='CO'>CO</option>
		<option value='CT'>CT</option>
		<option value='DE'>DE</option>
		<option value='FL'>FL</option>
		<option value='GA'>GA</option>
		<option value='HI'>HI</option>
		<option value='ID'>ID</option>
		<option value='IL'>IL</option>
		<option value='IN'>IN</option>
		<option value='IA'>IA</option>
		<option value='KS'>KS</option>
		<option value='KY'>KY</option>
		<option value='LA'>LA</option>
		<option value='ME'>ME</option>
		<option value='MD'>MD</option>
		<option value='MA'>MA</option>
		<option value='MI'>MI</option>
		<option value='MN'>MN</option>
		<option value='MS'>MS</option>
		<option value='MO'>MO</option>
		<option value='MT'>MT</option>
		<option value='NE'>NE</option>
		<option value='NV'>NV</option>
		<option value='NH'>NH</option>
		<option value='NJ'>NJ</option>
		<option value='NM'>NM</option>
		<option value='NY'>NY</option>
		<option value='NC'>NC</option>
		<option value='ND'>ND</option>
		<option value='OH'>OH</option>
		<option value='OK'>OK</option>
		<option value='OR'>OR</option>
		<option value='PA'>PA</option>
		<option value='RI'>RI</option>
		<option value='SC'>SC</option>
		<option value='SD'>SD</option>
		<option value='TN'>TN</option>
		<option value='TX'>TX</option>
		<option value='UT'>UT</option>
		<option value='VT'>VT</option>
		<option value='VA'>VA</option>
		<option value='WA'>WA</option>
		<option value='WV'>WV</option>
		<option value='WI'>WI</option>
		<option value='WY'>WY</option>
	</td>
</tr>
<tr>
	<td>Zip Code *</td>
	<td width='500'><input name='zipcode' size='60'></td>
</tr>
<tr>
	<td>Email *</td>
	<td width='500'><input name='email' size='60'></td>
</tr>
<tr>
	<td>Username *</td>
	<td width='500'><input name='username' size='60'></td>
</tr>
<tr>
	<td>Password *</td>
	<td width='500'><input name='password' size='60'></td>
</tr>
<tr>
	<td>ConfirmPassword *</td>
	<td width='500'><input name='confirmpassword' size='60'></td>
</tr>
</table>
<br>
<table border='0'>
<tr align='center' heigh='30px'>
	<td width='200px'><input type='submit' name='submit' value='SignMeUp'></td>
	<td width='200px'><input type='reset' name='reset' value='Clear'></td>
</tr>
</table>
</form>
</div>
</body>
</html>